
begintalkscript;

variables;

begintalknode 3;
	state = -1;
	nextstate = -1;
	question = "Druid";
	text1 = "You make small talk with this druid for a while, but you learn nothing new.";

begintalknode 4;
	state = -1;
	nextstate = -1;
	question = "Druid";
	text1 = "This druid is tending the Order Temple's gardens... and therefore has no time to talk with you.";

begintalknode 10;
	state = -1;
	nextstate = 10;
	question = "Brother Yewbeam";
	text1 = "A druid stands behind the counter, polishing a goblet.";
	text2 = "_Welcome to the Order's humble inn, the Swaying Yew. I am Brother Yewbeam. How may I help you?_";
	text5 = "Brother Yewbeam watches you calmly, polishing another goblet.";
	text6 = "_Welcome back, adventurers. Something I can get for you?_";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = -1;
	question = "Can I get something to drink?";
	text1 = "You finish buying your drinks.";
	code = 
		begin_shop_mode("Yewbeam's Brewery", "Brother Yewbeam is already very knowledgeable about the area flora, and his secondary training as a brewer puts that knowledge to good use.", 6, 1, -1);
	break;
begintalknode 12;
	state = 10;
	nextstate = 11;
	question = "So, how much is a room?";
	text1 = "_This may surprise you, but we don't charge for the room. It clashes with our order's teachings._";

begintalknode 13;
	state = 11;
	nextstate = -1;
	question = "Then why do you charge for drinks?";
	text1 = "_The inn is run by the Order. I run the brewery on the side, with the Order's permission. Since the Order doesn't run my brewery, I can charge for drinks._";
	text2 = "_Loopholes. You gotta love 'em._";

begintalknode 20;
	state = -1;
	nextstate = 20;
	question = "Brother Elm";
	text1 = "_Greetings, adventurers! I am Brother Elm. Welcome to our Order's temple._";
	text5 = "_Hello again. Is there anything I can help you with?_";
	action = INTRO;

begintalknode 21;
	state = 20;
	nextstate = -1;
	question = "Have you seen Brother Oakleaf anywhere?";
	text1 = "_Well, actually, you just missed him. He came by to pick up some of his possessions to replace what those lizards trashed. Thank you for saving him, by the way._";
	text2 = "_Truth is, sometimes he just isn't very smart about this stuff. I mean, we support him, but he must be crazy to take on the entire Order of Flame..._";
	text3 = "_Anyway, we are incredibly grateful for your bravery in saving Oakleaf. Please accept this as a token of our thanks._ He hands you a small pouch of coins.";
	code = 
		if (get_flag(3,2) != 1) {
			change_coins(500);
			set_flag(3,2,1);
		}
		else
		remove_string(3);
	break;
begintalknode 22;
	state = 20;
	nextstate = 21;
	condition = get_flag(4,0) == 1;
	question = "Why are there glowing flowers in the trees?";
	text1 = "_Well, let's just say that the Order is very powerful, and in tune with nature to the best of our abilities. We can grow some interesting plants._";

begintalknode 23;
	state = 21;
	nextstate = -1;
	question = "How else do you use your power?";
	text1 = "_Generally we use it to help the people of the valley, but sometimes we like to spruce up our own temple. Also, we've created some powerful artifacts in our time, though most of them are locked up._";
	text2 = "_And before you ask: you need the permission of a senior Order member to even see them._";
	text3 = "_And since you've been confirmed in the Order by Brother Oakleaf, you can go look at the artifacts. Heck, you can take them if it'll help you bring Ephesos back._";
	code = 
		if(has_special_item(0) != 1) {
			remove_string(3);
		}
		else {
		remove_string(2);
	}
	break;
begintalknode 24;
	state = 20;
	nextstate = -1;
	question = "Can you tell me anything about the Order of Krell?";
	text1 = "_Ah, for that you should talk with Brother Pinebranch. He's around here somewhere, probably napping._";

begintalknode 25;
	state = 20;
	nextstate = -1;
	condition = (get_flag(1,2) == 1) && (get_flag(3,3) != 1);
	question = "We met Brother Coldgale out on some remote hill. Why's he there?";
	text1 = "_I suppose you should know. He's guarding the Hilltop Sanctum, a place sacred to the Order. If you talk to him, I'm sure he'll let you in._";
	code = 
		set_flag(1,3,1); //Let you ask Coldgale to be let in
		set_flag(3,3,1); //Keep this vein of conversation from reappearing
	break;
begintalknode 26;
	state = 1;
	nextstate = -1;
	condition = (get_flag(3,0) == 1);
	question = "What's with the hedges?";
	text1 = "Brother Elm smiles kindly, realizing that you're still getting used to all of this.";
	text2 = "_These hedges have a powerful enchantment on them, so intruders will find unwelcome surprises. You know, thorns, rabid chipmunks, that kind of stuff._";
	text3 = "_It's easy for us to grow these walls, and we don't really like interrupting the natural landscape anyway, so it makes everyone happy._";

begintalknode 30;
	state = -1;
	nextstate = 30;
	question = "Brother Sharpclaw";
	text1 = "You approach the ursag with your weapons partially drawn. Much to your surprise, it doesn't try to kill you.";
	text2 = "_Put your weapons back, please. And don't look at me like that. It's impolite._";
	text3 = "_My name is Brother Sharpclaw, and I'm not going to try to kill you._";
	text5 = "Brother Sharpclaw stands serenely by the altar.";
	text6 = "_Hello again, fellow druids._";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	question = "We usually don't see many friendly Ursagi.";
	text1 = "_Ah, how common a reaction. No one ever suspects us of any virtue, they only see the claws._ Granted, they are big claws...";
	text2 = "_Anyway, I met an Order druid in the forest one day, and he was so surprised by the fact that I didn't kill him that he brought me here. I joined the Order, became a priest, and I've been studying with Skye here for six years now._";

begintalknode 32;
	state = 30;
	nextstate = 32;
	question = "So, what is it you do here?";
	text1 = "_Well, I can completely restore your party for a nominal fee of 300 coins... but if you're after spells, talk to Skye. I haven't studied that far yet._";

begintalknode 33;
	state = 32;
	nextstate = -1;
	question = "Could you heal us? (300 gold)";
	text1 = "_Why certainly. Just sit down and relax._";
	text3 = "_I'm sorry, but I usually charge 300 coins... if you can't afford my services, then I can't heal you._";
	text5 = "_Good to see that none of you need my help. It's good to see that the adventurers that we've set our hopes on can take care of themselves._";
	code = 
		clear_strings();
		//Not enough gold
		if (coins_amount() < 300) {
			add_string(3);
		}
		//Heal me
		else {
		play_sound(24);
		add_string(1);
		revive_party();
		change_coins(-300);
	}
	break;
begintalknode 34;
	state = 31;
	nextstate = -1;
	question = "Are people ever scared of you?";
	text1 = "Brother Sharpclaw looks puzzled. _Of course not... why would they? They know I work with the Order, so they know they have nothing to fear._";
	text2 = "These people clearly don't think like the average Empire citizen. Of course, that's not necessarily a bad thing.";

begintalknode 40;
	state = -1;
	nextstate = 40;
	question = "Skye";
	text1 = "As you approach the Temple's altar, you can't help but notice the dryad standing in front of the pedestals. She calmly beckons you forward.";
	text2 = "It's unusual to see a dryad anywhere outside of the deepest forests, but somehow it doesn't seem weird that one would be at home in the Order Temple.";
	text3 = "_Greetings, adventurers. My name is Skye, and I run the Order's main temple. Is there anything I can help you with?_";
	text5 = "Skye politely waits for you to speak.";
	action = INTRO;

begintalknode 41;
	state = 40;
	nextstate = 41;
	question = "What services do you offer here?";
	text1 = "_Well, holy rituals are my strong point, but I can also try to teach you how to get closer to nature._";
	text2 = "_Of course, I charge a slight fee for my teachings._";

begintalknode 42;
	state = 41;
	nextstate = -1;
	question = "What rituals can you teach?";
	text1 = "Skye spends some time explaining the holy rituals she's most familiar with.";
	text2 = "After she finishes, she asks _Anything else?_";
	code = 
		begin_shop_mode("Skye's Spells", "Skye seems very adept at holy rituals, and she seems more than willing to share some of her knowledge with you. Her calm attitude is a nice change of pace for you.", 10, 2, -1);
	break;
begintalknode 43;
	state = 41;
	nextstate = -1;
	question = "Teach me about nature.";
	text1 = "Skye finishes the lesson, and you feel much more relaxed.";
	text2 = "_Anything else?_";
	code = 
		begin_shop_mode("Skye's Nature Lore", "Skye already has a huge advantage in all aspects of nature lore, having spent a lot of her life in the forest. She kindly offers to teach you some of what she knows.", 11, 3, -1);
	break;
begintalknode 44;
	state = 40;
	nextstate = 42;
	question = "What do you think of what's going on?";
	text1 = "Skye frowns. This seems out of character, and you can read the concern in her face.";
	text2 = "_Well, it's been worse lately. With Ephesos gone, things are slowly getting away from us here. People are starting to argue fiercely, and Oakleaf has stormed off in a rage._";
	text3 = "_Even the Preserve is getting less ordered. I've heard that drakes are starting to nest in it, and that they're raiding the towns nearby. Because of all of this, I can't even enjoy a walk in the forest as often anymore._";
	text4 = "_If nothing is done soon, the Order's influence on the valley will falter, and chaos will ensue._";

begintalknode 45;
	state = 42;
	nextstate = -1;
	question = "Do you think Brother Oakleaf will find Ephesos?";
	text1 = "Again, Skye looks uncertain. This is very troubling to see in someone who's normally perfectly calm.";
	text2 = "_I'm certain Oakleaf will find Ephesos._ she says gravely. _I'm just worried they won't survive long enough to return._";
	text3 = "_There's no way he can do it alone and survive. You must help him before he gets himself hurt. The Order cannot afford to lose him and Ephesos._";

begintalknode 46;
	state = 42;
	nextstate = -1;
	question = "Drakes? In the Preserve?";
	text1 = "_Yes, it's sad but true. We've heard reports from Orrin about drake sightings, and we've had some of our gardeners attacked around the southern end of the preserve._";
	text2 = "_The Order of Flame is behind it somehow... I'm not quite sure how. As to why they've sent drakes, I really can't say._";

begintalknode 47;
	state = 40;
	nextstate = 43;
	question = "We don't usually run into too many dryads...";
	text1 = "Skye doesn't look surprised. _Well, it's not like we're terribly social. We spend most of our lives living with nature, so it's only natural that we don't hang around the Empire all that much._";
	text2 = "_The Order's an exception, though. Everybody here really cares about nature, so we can all connect on that level. Still, it helps that Brook works here in the Temple as well._";

begintalknode 48;
	state = 43;
	nextstate = -1;
	question = "Brook?";
	text1 = "_She's the only other dryad working here. She works in the kitchens upstairs. It really does help to have someone around who thinks like you do._";

begintalknode 50;
	state = -1;
	nextstate = 50;
	question = "Brother Pinebranch";
	text1 = "You enter the order members' living quarters, and find an aged druid relaxing in a small, wooden chair.";
	text2 = "_Greetings, fellow druids. I am Brother Pinebranch, eldest of the Order._";
	text5 = "Brother Pinebranch looks at you questioningly.";
	text6 = "_Need something, fellow druids?_";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = get_flag(3,1) == 0;
	question = "We aren't druids, just adventurers.";
	text1 = "_Are you sure about that?_ You think about it, but don't see what he's getting at.";
	text2 = "_Let me explain, then._ He clears his throat. _Back when the Order was newly founded, we had to make a name for ourselves, doing good around the valley, keeping the villages safe from any threatening monsters, you get the idea._";
	text3 = "_Soon people grew to respect us. Behind that, though, was the fact that the villagers had learned some respect for nature from us, because we saved them by using nature's power. Good became synonymous with nature, and vice versa._";
	text4 = "_I can see that you fight for good. It's plain as the light of day. We don't care if you use swords, fire, or fists to go about it, but it's still good work you do._";
	text5 = "_I respect you as an equal, a fellow crusader against evil. That is why I call you druids._";
	code = 
		set_flag(3,1,1);
	break;
begintalknode 52;
	state = 50;
	nextstate = 51;
	condition = get_flag(3,1) == 1;
	question = "Can you tell us about the Order's history?";
	text1 = "_Of course I can... I've been here since the Order was founded._";
	text2 = "_Back when we first settled this valley, it was filled with monsters. From goblins to drakes, we had them all. The poor villages we found were almost overrun._";
	text3 = "_We taught the villagers a bit of magic, a bit of defense, a bit about nature, and most importantly, how to survive. Our combined forces drove the monsters out, and our teachings helped the villagers' farms and towns flourish._";
	text4 = "_Eventually, we noticed that some drakes that roamed the eastern part of the valley were traveling in suspiciously-large groups. Soon we found that the Order of Flame had taken up residence in the mountains east of our valley._";
	text5 = "_Whereas we had taught the villagers peaceful arts, the Order of Flame taught its members how to cause more chaos than ever before. We barely fought them to a stalemate, which lasted until Ephesos was taken. Now the war continues._";

begintalknode 53;
	state = 51;
	nextstate = -1;
	question = "So, how old are you?";
	text1 = "He stares at you for some time.";
	text2 = "_Old enough to forget how old I am._";

begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = get_flag(3,1) == 1;
	question = "What can you tell us about Ephesos?";
	text1 = "_Hm... that's a long story. Well, he started off as a preacher on the Empire-controlled island of Krell, preaching freedom and oneness with nature. However, the Empire's presence grew oppressive, and Ephesos started preaching against their tyranny._";
	text2 = "_Predictably, he was thrown into Avernum. He told me that he spent the next few years wandering the caves, meditating. He practiced the same kindness he had shown on the surface, healing anyone and anything in need of it._";
	text3 = "_During the war against Avernum, Ephesos helped the Avernites hold their defenses, and became one of the first humans to make contact with the Vahnatai, after a party of adventurers told him of their plans._";
	text4 = "_After studying with the Vahnatai for three years, he finally returned to the surface, eventually wandering into this valley. He began gathering followers to help bring order to the valley, and soon the Order of Krell was created._";
	text5 = "_More recently, Ephesos stopped an invasion by a vengeful and misguided group of Vahnatai, who wanted to destroy the surface world for some reason. And of course, you know of his disappearance._";

begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = get_flag(3,1) == 1;
	question = "What can you tell us about Brother Oakleaf?";
	text1 = "Brother Pinebranch pauses to think. _Well, from what he's told us, he used to live on the island of Krell, just like Ephesos. He actually studied with Ephesos for quite some time, and preached Ephesos's message of freedom and oneness with nature._";
	text2 = "_Like Ephesos, Oakleaf was thrown into Avernum. They parted almost immediately, Oakleaf choosing to actively plot against the Empire. He studied at the Tower of Magi for some time, and helped plot Hawthorne's assassination._";
	text3 = "_When the war started, he served at the front lines, healing Avernites while slaying countless Empire soldiers. Still, by the war's end, he was ready to escape. He managed to find a route to the surface through miles of unexplored caves, quite a feat._";
	text4 = "_Upon returning to the surface, Oakleaf was appalled by the plagues ruining Valorim, and helped the Empire towns fight them off. Once adventurers stopped the plagues at the source, Oakleaf settled down and studied with the Anama for a year._";
	text5 = "_Soon, he took to wandering, and eventually wound up here. He joined Ephesos in cleaning up the valley, and helped found the Order._";

begintalknode 56;
	state = 51;
	nextstate = -1;
	condition = get_flag(3,1) == 1;
	question = "Why is it named the Order of Krell?";
	text1 = "_The Order is named after an Empire-controlled island to the southeast of Kriszan in Valorim. Both Ephesos and Oakleaf come from that island, and both used to preach there. That's really the only reason._";

